package com.tanhua.dubbo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanhua.model.domain.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author LiKe
 * @date 2022/1/21 16:44
 */
public interface UserInfoMapper extends BaseMapper<UserInfo> {
    /**
     * 分页查询黑名单
     * @param userId
     * @param start
     * @param size
     * @return
     */
    @Select("SELECT * from tb_user_info WHERE id IN (SELECT black_user_id FROM tb_black_list WHERE user_id = #{userId}) LIMIT #{start},#{size}")
    List<UserInfo> findByIdBlackLimit(@Param("userId") Long userId,@Param("start") int start,@Param("size") int size);
}
